package com.framework.login;

import com.framework.TestBase;
import com.framework.model.User;
import org.testng.annotations.Test;
import static org.junit.Assert.assertTrue;

public class AddNewUser extends TestBase {

    @Test
    public void addNewUserOK() {
        String username = "user" + System.currentTimeMillis();
        User user = new User()
                .setLogin(username)
                .setPassword("password")
                .setEmail(username + "@test.com");
        app.getUserHelper().loginAs(ADMIN);
        app.getUserHelper().createUser(user);
        app.getUserHelper().logout();
        app.getUserHelper().loginAs(user);
        assertTrue(app.getUserHelper().isLoggedInAs(user));
    }

}
